<template>
  <div class="BaseSearchBar">
    <el-card body-style="padding:0px">
      <el-row type="flex" justify="flex-start">
        <!-- 标题 -->
        <el-col :span="2" type="flex1" style="font-size:12px">
          <div class="search-title">条件搜索栏</div>
        </el-col>
        <!-- 搜索关键字 -->
        <el-col :span="4">
          <BaseSearchBarItem>
            <div slot="lable" class="key">搜索关键字:</div>
            <div slot="input">
              <el-input v-model="queryInfoChild.srm" placeholder="请输入关键字" />
            </div>
          </BaseSearchBarItem>
        </el-col>

        <!-- 抗菌药物 -->
        <el-col :span="4">
          <BaseSearchBarItem>
            <div slot="lable">抗菌药物:</div>
            <div slot="input">
              <el-select v-model="queryInfoChild.is_anti" placeholder="全部">
                <el-option
                  v-for="item in AntibacDrug"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </div>
          </BaseSearchBarItem>
        </el-col>

        <!-- 抗菌药物级别 -->
        <el-col :span="5">
          <BaseSearchBarItem>
            <div slot="lable">抗菌药物级别:</div>
            <div slot="input">
              <el-select v-model="queryInfoChild.antilevel" placeholder="全部">
                <el-option
                  v-for="item in AntibacGrade"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </div>
          </BaseSearchBarItem>
        </el-col>
        <!-- 按钮 -->
        <el-col :span="2" style="margin-left: 12px;display: flex;
        align-items: center;">
          <el-button type="primary" size="medium" v-on:click="SearchEvent">搜索</el-button>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>
<script>
import BaseSearchBarItem from "../../../components/BaseSearchBarItem";
export default {
  name: "BaseSearchBar",
  components: {
    BaseSearchBarItem
  },
  data() {
    return {
      AntibacDrug: [
        {
          value: "",
          label: "全部"
        },
        {
          value: 1,
          label: "是"
        },
        {
          value: 0,
          label: "否"
        }
      ],
      AntibacGrade: [
        {
          value: "",
          label: "全部"
        },
        {
          value: -1,
          label: "非抗菌药物"
        },
        {
          value: 1,
          label: "非限制使用"
        },
        {
          value: 2,
          label: "限制使用"
        },
        {
          value: 3,
          label: "特殊使用"
        }
      ],
      queryInfoChild: {
        srm: "",
        // 当前的页数
        is_anti: "",
        antilevel: ""
      }
    };
  },
  methods: {
    SearchEvent: function() {
      // console.log(this.queryInfoChild)
      this.$emit("ChildSearchEvent", this.queryInfoChild);
    }
  }
};
</script>
<style>
.search-title {
  color: #696969;
  border-right: 1px solid #c2c2c2;
  height: 50px;
  text-align: center;
  line-height: 50px;
}
</style>
